<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="lib/vue.js"></script>
</head>
<body>
<div id="root">
    <p>{{name}}</p>
    <one :change-name="changeName"></one>
</div>
</body>
<script>
    new Vue({
        el: "#root",
        data :{
            name :'sxx'
        },
        methods:{
            changeName(name){
                this.name = name;
            }
        },
        components:{
            One:{
                props:{
                    changeName :Function
                },
                template:(`
				    <div>
				        <h3></h3>
				        <button @click="changeName('dcl')">点击</button>
                    </div>
				`),
            }
        }
    })
</script>
</html>